package cc.mrbird.assets.domain;

import cc.mrbird.common.annotation.ExportConfig;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Table(name="asset_mana")
public class AssetMana implements Serializable {
    /**
     *资产信息包括设备ID（可在单位ID后面+类型编码+序号，自动生成）、资产类型、
     * 部署位置（单位、园区、楼、单元、层、房间等）、安全负责人（选取）、
     * 安全巡查人（选取）、设备状态（启用或未启用）、是否是巡查点等信息，以及关联监控的摄像头ID、
     * 位置信息平面图（GIS地图二期）、生产厂商、设备型号、报废时间、施工单位等。
     */
    private static final long serialVersionUID = 7780821231535881125L;
    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(name = "assetMana_id")
    private Integer assetMana_id;

    @Column(name = "asset_type")
    @ExportConfig(value = "资产类型")
    private String asset_type;

    @Column(name = "asset_name")
    @ExportConfig(value = "设备名称")
    private String asset_name;

    @Column(name = "deployment_location")
    @ExportConfig(value = "部署位置")
    private String deployment_location;
    private String unit;
    private String park;
    private String tower;
    private String layer;
    private String element;
    private String home;
    @Column(name = "camera_ID")
    @ExportConfig(value = "摄像头ID")
    private String camera_ID;

    @Column(name = "information_plan")
    @ExportConfig(value = "位置信息平面图")
    private String information_plan;

    @Column(name = "safety_officer")
    @ExportConfig(value = "安全负责人")
    private String safety_officer;
    @Column(name = "security_inspector")
    @ExportConfig(value = "安全巡查人")
    private String security_inspector;

    @Column(name = "equipment_status")
    private Integer equipment_status;//0启用(正常),1未启用,2告警,3未连通

    @ExportConfig(value = "设备状态")
    private String equipment_statusStr;

    @Column(name = "patrol_point")
    @ExportConfig(value = "是否是巡查点")
    private String patrol_point;


    @Column(name = "manufacturers")
    @ExportConfig(value = "生产厂商")
    private String manufacturers;

    @Column(name = "equipment_model")
    @ExportConfig(value = "设备型号")
    private String equipment_model;

    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    @Column(name = "discard_time")
    @ExportConfig(value = "报废时间",convert = "c:cc.mrbird.common.util.poi.convert.TimeConvert")
    private Date discard_time;

    @Column(name = "construction_unit")
    @ExportConfig(value = "施工单位")
    private String construction_unit;

    @Column(name = "unit_id")
    private Long unit_id;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getAssetMana_id() {
        return assetMana_id;
    }

    public void setAssetMana_id(Integer assetMana_id) {
        this.assetMana_id = assetMana_id;
    }

    public String getAsset_type() {
        return asset_type;
    }

    public void setAsset_type(String asset_type) {
        this.asset_type = asset_type;
    }

    public String getAsset_name() {
        return asset_name;
    }

    public void setAsset_name(String asset_name) {
        this.asset_name = asset_name;
    }

    public String getDeployment_location() {
        return deployment_location;
    }

    public void setDeployment_location(String deployment_location) {
        this.deployment_location = deployment_location;
    }

    public String getSafety_officer() {
        return safety_officer;
    }

    public void setSafety_officer(String safety_officer) {
        this.safety_officer = safety_officer;
    }

    public String getSecurity_inspector() {
        return security_inspector;
    }

    public void setSecurity_inspector(String security_inspector) {
        this.security_inspector = security_inspector;
    }

    public Integer getEquipment_status() {
        return equipment_status;
    }

    public void setEquipment_status(Integer equipment_status) {
        this.equipment_status = equipment_status;
    }

    public String getEquipment_statusStr() {
        return equipment_statusStr;
    }

    public void setEquipment_statusStr(String equipment_statusStr) {
        //0启用(正常),1未启用,2告警,3未连通
        if(equipment_status==0){
            equipment_statusStr="正常";
        } if(equipment_status==1){
            equipment_statusStr="未启用";
        }if(equipment_status==2){
            equipment_statusStr="告警";
        }if(equipment_status==3){
            equipment_statusStr="未连通";
        }
        this.equipment_statusStr = equipment_statusStr;
    }

    public String getPatrol_point() {
        return patrol_point;
    }

    public void setPatrol_point(String patrol_point) {
        this.patrol_point = patrol_point;
    }

    public String getCamera_ID() {
        return camera_ID;
    }

    public void setCamera_ID(String camera_ID) {
        this.camera_ID = camera_ID;
    }

    public String getInformation_plan() {
        return information_plan;
    }

    public void setInformation_plan(String information_plan) {
        this.information_plan = information_plan;
    }

    public String getManufacturers() {
        return manufacturers;
    }

    public void setManufacturers(String manufacturers) {
        this.manufacturers = manufacturers;
    }

    public String getEquipment_model() {
        return equipment_model;
    }

    public void setEquipment_model(String equipment_model) {
        this.equipment_model = equipment_model;
    }

    public Date getDiscard_time() {
        return discard_time;
    }

    public void setDiscard_time(Date discard_time) {
        this.discard_time = discard_time;
    }

    public String getConstruction_unit() {
        return construction_unit;
    }

    public void setConstruction_unit(String construction_unit) {
        this.construction_unit = construction_unit;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getPark() {
        return park;
    }

    public void setPark(String park) {
        this.park = park;
    }

    public String getTower() {
        return tower;
    }

    public void setTower(String tower) {
        this.tower = tower;
    }

    public String getLayer() {
        return layer;
    }

    public void setLayer(String layer) {
        this.layer = layer;
    }

    public String getElement() {
        return element;
    }

    public void setElement(String element) {
        this.element = element;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }

    public Long getUnit_id() {
        return unit_id;
    }

    public void setUnit_id(Long unit_id) {
        this.unit_id = unit_id;
    }

    @Override
    public String toString() {
        return "AssetMana{" +
                "assetMana_id=" + assetMana_id +
                ", asset_type='" + asset_type + '\'' +
                ", asset_name='" + asset_name + '\'' +
                ", deployment_location='" + deployment_location + '\'' +
                ", unit='" + unit + '\'' +
                ", park='" + park + '\'' +
                ", tower='" + tower + '\'' +
                ", layer='" + layer + '\'' +
                ", element='" + element + '\'' +
                ", home='" + home + '\'' +
                ", camera_ID='" + camera_ID + '\'' +
                ", information_plan='" + information_plan + '\'' +
                ", safety_officer='" + safety_officer + '\'' +
                ", security_inspector='" + security_inspector + '\'' +
                ", equipment_status=" + equipment_status +
                ", equipment_statusStr='" + equipment_statusStr + '\'' +
                ", patrol_point='" + patrol_point + '\'' +
                ", manufacturers='" + manufacturers + '\'' +
                ", equipment_model='" + equipment_model + '\'' +
                ", discard_time=" + discard_time +
                ", construction_unit='" + construction_unit + '\'' +
                ", unit_id=" + unit_id +
                '}';
    }
}
